package cn.wh.beans.factory.support;

import cn.wh.beans.factory.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author wanghao
 * @Date 2022-08-21 1:02
 * @Description: 单例bean 注册实现
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {

    private Map<String,Object> map=new HashMap<>();

    @Override
    public Object getSingletonBean(String beanName) {
        return map.get(beanName);
    }
    public void addSingletonBean(String beanName,Object beanClass){
        map.put(beanName,beanClass);
    }
}
